package cd.safe.school.activity;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import cd.safe.school.R;
import cd.safe.school.adapter.SchoolSMSAdapter2;
import cd.safe.school.bean.Student;

public class MaindetailActivity extends Activity {
	private ListView main_item;
	private List<Map<String, Object>> lists = new ArrayList<Map<String, Object>>();
//	private List<Student> list = MainActivity.getdata();

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main_item);
		HomeActivity.rutn=6;
		main_item = (ListView) findViewById(R.id.main_item);
//		for (Student s : list) {
//			Map<String, Object> map = new HashMap<String, Object>();
//			map.put("person_biaoti", s.getName());
//			map.put("person_xinxiji", s.getLastlogin());
//			map.put("time", s.getPhone());
//			lists.add(map);
//		}

		SchoolSMSAdapter2 adapter = new SchoolSMSAdapter2(
				MaindetailActivity.this, lists);
		main_item.setAdapter(adapter);

		main_item.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> parent, View view,
					int position, long id) {
				Intent intent = new Intent(MaindetailActivity.this,
						SchoolSMS_detail.class);
				intent.putExtra("tag", "kkk");
				startActivity(intent);

			}
		});

	}

}
